package com.sourcemuch.im.caiba.wxapi;

import android.os.Parcel;

import androidx.annotation.NonNull;

import java.util.List;

import cn.wildfire.chat.app.extendsion.classes.GsonObject;

/**
 * Create by HEKE, 2019/10/14 14:12
 * TODO 微信用户信息对象
 */
public class WXUserInfo extends GsonObject {

    public String openid;
    public String nickname;
    public String sex;
    public String province;
    public String city;
    public String country;
    public String headimgurl;
    public List<String> privilege;
    public String unionid;

    public String mobile;
    public String regionId;
    public String code;
    public String clientId;
    public String uid;

    public WXUserInfo() {
    }

    protected WXUserInfo(Parcel in) {
        openid = in.readString();
        nickname = in.readString();
        sex = in.readString();
        province = in.readString();
        city = in.readString();
        country = in.readString();
        headimgurl = in.readString();
        privilege = in.createStringArrayList();
        unionid = in.readString();
        mobile = in.readString();
        regionId = in.readString();
        code = in.readString();
        clientId = in.readString();
        uid = in.readString();
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(openid);
        dest.writeString(nickname);
        dest.writeString(sex);
        dest.writeString(province);
        dest.writeString(city);
        dest.writeString(country);
        dest.writeString(headimgurl);
        dest.writeStringList(privilege);
        dest.writeString(unionid);
        dest.writeString(mobile);
        dest.writeString(regionId);
        dest.writeString(code);
        dest.writeString(clientId);
        dest.writeString(uid);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<WXUserInfo> CREATOR = new Creator<WXUserInfo>() {
        @Override
        public WXUserInfo createFromParcel(Parcel in) {
            return new WXUserInfo(in);
        }

        @Override
        public WXUserInfo[] newArray(int size) {
            return new WXUserInfo[size];
        }
    };

    public String getOpenid() {
        return openid;
    }

    public void setOpenid(String openid) {
        this.openid = openid;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public String getProvince() {
        return province;
    }

    public void setProvince(String province) {
        this.province = province;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getCountry() {
        return country;
    }

    public void setCountry(String country) {
        this.country = country;
    }

    public String getHeadimgurl() {
        return headimgurl;
    }

    public void setHeadimgurl(String headimgurl) {
        this.headimgurl = headimgurl;
    }

    public List<String> getPrivilege() {
        return privilege;
    }

    public void setPrivilege(List<String> privilege) {
        this.privilege = privilege;
    }

    public String getUnionid() {
        return unionid;
    }

    public void setUnionid(String unionid) {
        this.unionid = unionid;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public String getRegionId() {
        return regionId;
    }

    public void setRegionId(String regionId) {
        this.regionId = regionId;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getClientId() {
        return clientId;
    }

    public void setClientId(String clientId) {
        this.clientId = clientId;
    }

    public String getUid() {
        return uid;
    }

    public void setUid(String uid) {
        this.uid = uid;
    }

    @NonNull
    @Override
    public String toString() {
        return toNormalJson();
    }

}
